
function get-vsswriter {
    $arr_writers = vssadmin list writers
    $str_writers = [string]::join("`n", $arr_writers)
    $arr_writers = $str_writers -split "`n`n"

    for ($i=1; $i -lt $arr_writers.count; $i++) {
      $writer = $arr_writers[$i] -split "`n"
      
      $ismatch = $writer[0] -match "(Writer name: ')(?<name>.+)(')"
      $name = $matches["name"]
      
      $ismatch = $writer[1] -match "(\s+Writer Id:\s+{)(?<id>.+)(})"
      $id = $matches["id"]
      
      $vsswriter = New-Object psobject
      $vsswriter | add-member noteproperty ID $id
      $vsswriter | add-member noteproperty Name $name
      $vsswriter
    }
}

$writers = get-vsswriter

$writers
